
func int b_teachstamina(var C_Npc slf,var C_Npc oth,var int talent,var int staminaplus)
{
	var string concatText;
	var int kosten;
	var int money;
	kosten = B_GetLearnCostTalent(oth,talent,staminaplus);
	money = kosten * 100;
	if(talent != NPC_TALENT_STAMINA)
	{
		Print("*** ERROR: Wrong Parameter ***");
		return FALSE;
	};
	if(oth.lp < kosten)
	{
		PrintScreen(PRINT_NotEnoughLearnPoints,-1,-1,FONT_ScreenSmall,2);
		B_Say(slf,oth,"$NOLEARNNOPOINTS");
		return FALSE;
	};
	if(Npc_HasItems(oth,ItMi_Gold) < money)
	{
		PrintScreen(Print_NotEnoughGold,-1,-1,FONT_Screen,2);
		B_Say(slf,oth,"$ShitNoGold");
		return FALSE;
	};
	if(ATR_STAMINA_MAX >= 100)
	{
		PrintScreen(PRINT_NOLEARNOVERSTAMINAMAX,-1,-1,FONT_Screen,2);
		B_Say(slf,oth,"$NOLEARNYOUREBETTER");
		return FALSE;
	};
	oth.lp = oth.lp - kosten;
	Npc_RemoveInvItems(oth,ItMi_Gold,money);
	if(talent == NPC_TALENT_STAMINA)
	{
		ATR_STAMINA_MAX = ATR_STAMINA_MAX + staminaplus;
		ATR_STAMINA = ATR_STAMINA + (staminaplus * 10);
		Npc_SetTalentSkill(oth,NPC_TALENT_STAMINA,ATR_STAMINA_MAX);
		concatText = ConcatStrings(PRINT_LEARNSTAMINA_MAX,IntToString(staminaplus));
		PrintScreen(concatText,-1,-1,FONT_Screen,2);
		Snd_Play("LevelUP");
		return TRUE;
	};
	return FALSE;
};

